package com.uetoken.cn.fragment;


import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.blankj.utilcode.util.BarUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.google.gson.Gson;
import com.qmuiteam.qmui.util.QMUIStatusBarHelper;
import com.qmuiteam.qmui.widget.QMUIRadiusImageView;
import com.qmuiteam.qmui.widget.QMUITopBar;
import com.qmuiteam.qmui.widget.dialog.QMUIDialog;
import com.qmuiteam.qmui.widget.dialog.QMUIDialogAction;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.constant.RefreshState;
import com.scwang.smartrefresh.layout.listener.SimpleMultiPurposeListener;
import com.uetoken.cn.R;
import com.uetoken.cn.activity.FundAssetDetailsActivity;
import com.uetoken.cn.activity.LoginActivity;
import com.uetoken.cn.activity.RegisterActivity;
import com.uetoken.cn.activity.ScanQrCodeActivity;
import com.uetoken.cn.activity.WebActivity;
import com.uetoken.cn.adapter.AssetsMainRecyclerAdapter;
import com.uetoken.cn.adapter.BaseViewHolder;
import com.uetoken.cn.adapter.GroupedRecyclerViewAdapter;
import com.uetoken.cn.adapter.holder.AbnormalViewHolder;
import com.uetoken.cn.adapter.model.AssetsMainModel;
import com.uetoken.cn.base.BaseFragment;
import com.uetoken.cn.bean.PurseListBean;
import com.uetoken.cn.common.ApiHelper;
import com.uetoken.cn.common.Constant;
import com.uetoken.cn.network.OkHttpUtils;
import com.uetoken.cn.network.Params;
import com.uetoken.cn.network.WebResponse;
import com.uetoken.cn.utils.AppUtils;
import com.uetoken.cn.utils.ClipboardHelper;
import com.uetoken.cn.utils.GlideApp;
import com.uetoken.cn.utils.GlideUtils;
import com.uetoken.cn.utils.PhotoUtils;
import com.yanzhenjie.permission.Action;
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.Permission;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import butterknife.BindView;
import butterknife.ButterKnife;
import okhttp3.Call;

import static android.app.Activity.RESULT_OK;

/**
 * A simple {@link Fragment} subclass.
 * 资产
 */
public class AssetsFragment extends BaseFragment implements WebResponse, Handler.Callback, AbnormalViewHolder.OnRegainClickListener {

    @BindView(R.id.topbar)
    QMUITopBar mTopBar;
    @BindView(R.id.assetsTopLayout)
    RelativeLayout assetsTopLayout;
    @BindView(R.id.recyclerView)
    RecyclerView mRecyclerView;
    @BindView(R.id.abnormalLayout)
    FrameLayout mAbnormalLayout;
    @BindView(R.id.refreshLayout)
    SmartRefreshLayout refreshLayout;

    /**
     * 登录状态下显示的view
     */
    private View logginView;
    /**
     * 没有登录状态下显示的view
     */
    private View notLoginView;
    /**
     * 获取用户钱包列表网络请求码
     */
    private static final int REQUEST_NETWORK_PURSE_LIST = 10;
    /**
     * 获取区块链钱包网络请求码
     * Blockchain
     */
    private static final int REQUEST_NETWORK_BLOCKCHAIN_PURSE_LIST = 11;
    /**
     * 扫描二维码的请求码
     */
    private static final int INENT_REQUEST_CODE_SCAN = 101;
    /**
     * 用户是否登录
     */
    private boolean isLogin;
    /**
     * 数据获取错误下的view
     */
    private View abnormalView;
    /**
     * 判断是否有网络
     */
    private boolean noNetwork = false;
    /**
     * 判断是否有网络
     */
    private boolean isAbnormal = false;
    /**
     * 用户id
     */
    private String nodeid;
    /**
     * 是否正在下拉刷新
     */
    private boolean isSwipeRefreshing = false;

    private Handler mHandler;
    private AssetsMainRecyclerAdapter adapter;
    private List<AssetsMainModel> mAssetsMainModelList;
    private View rootView;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        rootView = inflater.inflate(R.layout.fragment_assets, container, false);
        return rootView;
    }

    @Override
    public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ButterKnife.bind(this, view);
        QMUIStatusBarHelper.setStatusBarLightMode(getActivity());
        mHandler = new Handler(this);
        refreshLayout.setEnableLoadMore(false);
        refreshLayout.setOnRefreshListener(new SimpleMultiPurposeListener() {
            @Override
            public void onStateChanged(@NonNull RefreshLayout refreshLayout, @NonNull RefreshState oldState, @NonNull RefreshState newState) {
                if (oldState == RefreshState.LoadFinish && newState == RefreshState.None) {
                    refreshLayout.autoRefresh();
                    refreshLayout.setOnMultiPurposeListener(null);
                }
            }

            @Override
            public void onRefresh(@NonNull RefreshLayout refreshLayout) {
                refreshLayout.finishRefresh();
                getPurseList();
            }
        });
        initTopBar();
        initRecyclerView();
        initHeadViewAndData();
    }

    private void getPurseList() {
        LogUtils.dTag("getPurseList==", "getPurseList== isLogin==" + isLogin);
        if (isLogin) {
            //获取钱包列表
            showLoading();
            OkHttpUtils.getInstance().getStringWithParam(this, ApiHelper.getPurseListUrl(), REQUEST_NETWORK_PURSE_LIST, Params.getPurseListParams());
//            OkHttpUtils.getInstance().getStringWithParam(this, ApiHelper.getTransPurses(), REQUEST_NETWORK_BLOCKCHAIN_PURSE_LIST, Params.getTransPursesParams(nodeid));
        }
    }

    public void initHeadViewAndData() {
        isLogin = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getBoolean(Constant.SP_WHETHER_LOGIN, false);
        if (isLogin) {
            assetsTopLayout.removeAllViews();
            //已登录
            logginView = LayoutInflater.from(getActivity()).inflate(R.layout.view_asserts_loggin_in, assetsTopLayout, false);
            assetsTopLayout.addView(logginView);
            /**
             * 用户头像地址
             */
            nodeid = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_ID, "");
            String photoUrl = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_HEAD_PHOTO, "");
            String name = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_NAME, "");
            String mobile = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_MOBILE_NO, "");
            String nodeCode = SPUtils.getInstance(Constant.UE_TOKEN_PREFERENCE_USER_INFO).getString(Constant.SP_NODE_CODE, "");
            LogginViewHolder logginViewHolder = new LogginViewHolder(logginView);
            GlideApp.with(getActivity()).load(photoUrl).apply(GlideUtils.getOptions()).into(logginViewHolder.mMQMUIRadiusImageView);
            logginViewHolder.mUserNameTv.setText(name + "(" + nodeCode + ")");
            if (!TextUtils.isEmpty(mobile)) {
                logginViewHolder.mUserNameIDTv.setText(mobile);
            }

            logginViewHolder.mQrCodeScanIv.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    //当前手机版本低于23时，用此方法来判断相机是否可用
                    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                        if (!PhotoUtils.cameraIsCanUse()) {
                            //相机不可用
                            ToastUtils.showShort(getResources().getString(R.string.str_camera_not_use));
                            return;
                        }
                    }
                    AndPermission.with(getActivity()).runtime().permission(Permission.Group.CAMERA).onGranted(new Action<List<String>>() {
                        @Override
                        public void onAction(List<String> data) {
                            Intent intent = new Intent(getActivity(), ScanQrCodeActivity.class);
                            startActivityForResult(intent, INENT_REQUEST_CODE_SCAN);
                        }
                    }).onDenied(new Action<List<String>>() {
                        @Override
                        public void onAction(List<String> data) {
                            ToastUtils.showShort(getResources().getString(R.string.str_camera_not_use));
                        }
                    }).start();
                }
            });

        } else {
            assetsTopLayout.removeAllViews();
            //未登录
            notLoginView = LayoutInflater.from(getActivity()).inflate(R.layout.view_asserts_not_loggin, assetsTopLayout, false);
            assetsTopLayout.addView(notLoginView);
            NotLogginViewHolder notLoggedInViewHolder = new NotLogginViewHolder(notLoginView);

            notLoggedInViewHolder.mTvLogin.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent = new Intent(getActivity(), LoginActivity.class);
                    intent.putExtra("flag", "assert");
                    startActivity(intent);
                }
            });

            notLoggedInViewHolder.mTvRegister.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    startActivity(new Intent(getActivity(), RegisterActivity.class));
                }
            });
        }
    }

    public void initTopBar() {
//        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT
//                && !Build.BRAND.toLowerCase().contains("essential")) {
//            // Essential Phone 不支持沉浸式，否则系统又不从状态栏下方开始布局又给你下发 WindowInsets
//            LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mTopBar.getLayoutParams();
//            params.topMargin = BarUtils.getStatusBarHeight();
//            mTopBar.setLayoutParams(params);
//        }
        mTopBar.setTitle(getResources().getString(R.string.tabbar_property_txt));
        mTopBar.setBackgroundColor(getResources().getColor(R.color.qmui_config_color_white));
        mTopBar.addRightImageButton(R.drawable.ic_scan, R.id.topbar_right_change_button)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        //当前手机版本低于23时，用此方法来判断相机是否可用
                        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
                            if (!PhotoUtils.cameraIsCanUse()) {
                                //相机不可用
                                ToastUtils.showShort(getResources().getString(R.string.str_camera_not_use));
                                return;
                            }
                        }
                        AndPermission.with(getActivity()).runtime().permission(Permission.Group.CAMERA).onGranted(new Action<List<String>>() {
                            @Override
                            public void onAction(List<String> data) {
                                Intent intent = new Intent(getActivity(), ScanQrCodeActivity.class);
                                startActivityForResult(intent, INENT_REQUEST_CODE_SCAN);
                            }
                        }).onDenied(new Action<List<String>>() {
                            @Override
                            public void onAction(List<String> data) {
                                ToastUtils.showShort(getResources().getString(R.string.str_camera_not_use));
                            }
                        }).start();
                    }
                });
    }

    public void initRecyclerView() {
        mAssetsMainModelList = new ArrayList<>();

        mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
        //初始化适配器
        adapter = new AssetsMainRecyclerAdapter(getActivity(), mAssetsMainModelList);
        adapter.setOnHeaderClickListener(new GroupedRecyclerViewAdapter.OnHeaderClickListener() {
            @Override
            public void onHeaderClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder,
                                      int groupPosition) {
                AssetsMainRecyclerAdapter expandableAdapter = (AssetsMainRecyclerAdapter) adapter;
                if (expandableAdapter.isExpand(groupPosition)) {
                    expandableAdapter.collapseGroup(groupPosition);
                } else {
                    expandableAdapter.expandGroup(groupPosition);
                }
            }
        });
        adapter.setOnChildClickListener(new GroupedRecyclerViewAdapter.OnChildClickListener() {
            @Override
            public void onChildClick(GroupedRecyclerViewAdapter adapter, BaseViewHolder holder,
                                     int groupPosition, int childPosition) {
                AssetsMainModel.AssetsDetailModel assetsDetailModel = mAssetsMainModelList.get(groupPosition).getmAssetsDetailModelList().get(childPosition);
                Intent intent = new Intent(getActivity(), FundAssetDetailsActivity.class);
                intent.putExtra("assetsDetailModel", assetsDetailModel.getDataBean());
//                intent.putExtra("mId", String.valueOf(assetsDetailModel.getDataBean().getId()));
//                intent.putExtra("purseId", String.valueOf(assetsDetailModel.getDataBean().getPurseid()));
//                intent.putExtra("purseName", assetsDetailModel.getDataBean().getPursename());
//                intent.putExtra("balance", String.valueOf(assetsDetailModel.getDataBean().getBalance()));
//                intent.putExtra("freeze", String.valueOf(assetsDetailModel.getDataBean().getFreeze()));
//                intent.putExtra("operation", String.valueOf(assetsDetailModel.getDataBean().getOperation()));
//                intent.putExtra("pursepic", assetsDetailModel.getDataBean().getPursepic());
                startActivity(intent);
            }
        });
        mRecyclerView.setAdapter(adapter);
    }

    private void initAbnormalLayout(boolean noNetwork) {
        AbnormalViewHolder mAbnormalViewHolder;
        if (!isAbnormal) {
            isAbnormal = true;
            abnormalView = LayoutInflater.from(getActivity()).inflate(R.layout.view_abnormal, null, false);
            mAbnormalLayout.addView(abnormalView);

            mAbnormalViewHolder = new AbnormalViewHolder(abnormalView);
            mAbnormalLayout.setTag(mAbnormalViewHolder);
        } else {
            mAbnormalViewHolder = (AbnormalViewHolder) mAbnormalLayout.getTag();
        }
        mAbnormalViewHolder.setOnRegainClickListener(this);
        if (noNetwork) {
            mAbnormalViewHolder.mAbnormalIv.setImageResource(R.drawable.ic_no_network);
            mAbnormalViewHolder.mAbnormalTv.setText(R.string.str_abnormal_nonetwork_explain);
        } else {
            mAbnormalViewHolder.mAbnormalIv.setImageResource(R.drawable.ic_no_data);
            mAbnormalViewHolder.mAbnormalTv.setText(R.string.str_abnormal_nocontent_explain);
        }
    }

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        if (getUserVisibleHint()) {
            QMUIStatusBarHelper.setStatusBarLightMode(getActivity());
            getPurseList();
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        QMUIStatusBarHelper.setStatusBarLightMode(getActivity());
        getPurseList();
    }

    @Override
    public void onSuccessResponse(Call call, String response, final int requestCode) throws IOException {
        switch (requestCode) {
            case REQUEST_NETWORK_PURSE_LIST:
                dissmissDialog();
                refreshLayout.finishRefresh();
                if (mAssetsMainModelList.size() != 0) {
                    mAssetsMainModelList.clear();
                }
                try {
                    PurseListBean purseListBean = new Gson().fromJson(response, PurseListBean.class);
                    if (purseListBean.getResult() > 0) {
                        List<PurseListBean.DataBean> dataBeans = purseListBean.getData();
                        //通过一个map集合来统计有多少种钱包类型(相同的键会被覆盖)LinkedHashMap为有序的
                        Map<Integer, PurseListBean.DataBean> map = new LinkedHashMap<>();
                        for (int i = 0; i < dataBeans.size(); i++) {
                            map.put(dataBeans.get(i).getPursetypeid(), dataBeans.get(i));
                        }
                        // 得到全部的key
                        Set<Integer> keys = map.keySet();
                        Iterator<Integer> iter = keys.iterator();
                        //遍历key（最外层钱包类型id）
                        while (iter.hasNext()) {
                            int key = iter.next();
                            final AssetsMainModel mAssetsMainModel1 = new AssetsMainModel();
                            StringBuffer stringBuffer = new StringBuffer();
                            //存放子item的集合
                            List<AssetsMainModel.AssetsDetailModel> mAssetsDetailModelList11 = new ArrayList<>();
                            for (int j = 0; j < dataBeans.size(); j++) {
                                if (key == dataBeans.get(j).getPursetypeid()) {
                                    PurseListBean.DataBean dataBean = dataBeans.get(j);
                                    stringBuffer.append(" " + dataBean.getPursename());
                                    AssetsMainModel.AssetsDetailModel mAssetsDetailModel = mAssetsMainModel1.new AssetsDetailModel();
                                    mAssetsDetailModel.setId(dataBean.getId());
                                    //将dataBean set给AssetsDetailModel方便后面点击子item传值
                                    mAssetsDetailModel.setDataBean(dataBean);
                                    //子item名字
                                    mAssetsDetailModel.setSubitemText(dataBean.getPursename());
                                    //余额
                                    mAssetsDetailModel.setAmount(dataBean.getBalance());
                                    //冻结
                                    mAssetsDetailModel.setSubitemAmount(dataBean.getFreeze());
                                    //可用余额格式化
                                    mAssetsDetailModel.setBalanceformat(dataBean.getBalanceformat());
                                    //交易中金额
                                    mAssetsDetailModel.setTransactionamount(dataBean.getTransactionamount());
                                    //钱包类型ID
                                    mAssetsDetailModel.setPursetypeid(dataBean.getPursetypeid());
                                    //代币价格(汇率)
                                    mAssetsDetailModel.setPrice(dataBean.getPrice());
                                    //涨跌(1=涨，0=跌)
                                    mAssetsDetailModel.setFlag(dataBean.getFlag());

                                    mAssetsDetailModelList11.add(mAssetsDetailModel);
                                }
                            }
                            mAssetsMainModel1.setImageResource(map.get(key).getPursetypepic());
                            mAssetsMainModel1.setTitleText(map.get(key).getPursetypename());
                            mAssetsMainModel1.setDetailText(stringBuffer.toString());
                            mAssetsMainModel1.setExpand(true);
                            mAssetsMainModel1.setmAssetsDetailModelList(mAssetsDetailModelList11);
                            mAssetsMainModelList.add(mAssetsMainModel1);
                        }
                        Message message = new Message();
                        message.obj = mAssetsMainModelList;
                        message.what = Constant.HANDLER_MESSAGE_WHAT_1100;
                        mHandler.sendMessage(message);
                    } else {
                        ToastUtils.showShort(purseListBean.getMessage());
                    }
                } catch (Exception e) {
                    LogUtils.e(e.getMessage());
                }
                break;
            default:
                break;
        }
        LogUtils.dTag("onSuccessResponse== ", "response = " + response + " requestCode = " + requestCode);
    }

    @Override
    public void onFailResponse(Call call, IOException e, int requestCode) {
        Message message = new Message();
        message.what = Constant.HANDLER_MESSAGE_WHAT_1101;
        mHandler.sendMessage(message);
    }

    @Override
    public boolean handleMessage(Message msg) {
        switch (msg.what) {
            case Constant.HANDLER_MESSAGE_WHAT_1100:
                List<AssetsMainModel> purseList = (List<AssetsMainModel>) msg.obj;
                if (purseList.size() <= 0) {
                    mAbnormalLayout.setVisibility(View.VISIBLE);
                    mRecyclerView.setVisibility(View.GONE);
                    noNetwork = false;
                    initAbnormalLayout(noNetwork);
                } else {
                    mAbnormalLayout.setVisibility(View.GONE);
                    mRecyclerView.setVisibility(View.VISIBLE);
                    adapter.notifyDataChanged();
                    //默认展开第一项
                    adapter.expandGroup(0);
                }
                break;
            case Constant.HANDLER_MESSAGE_WHAT_1101:
                dissmissDialog();
                noNetwork = true;
                mAbnormalLayout.setVisibility(View.VISIBLE);
                mRecyclerView.setVisibility(View.GONE);
                initAbnormalLayout(noNetwork);
                break;
        }
        return false;
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        // 扫描二维码/条码回传
        if (requestCode == INENT_REQUEST_CODE_SCAN && resultCode == RESULT_OK) {
            if (data != null) {
                String content = data.getStringExtra("qrCode");
                if (TextUtils.isEmpty(content)) {
                    ToastUtils.showShort(getResources().getString(R.string.str_no_address));
                    return;
                }

                String regex = Constant.URL_REGEX;
                Pattern pattern = Pattern.compile(regex);
                Matcher matcher = pattern.matcher(content);
                //符合url正则表达式
                if (matcher.matches()) {
                    //不是以http开头的添加http://
                    if (content.indexOf("http") != 0) {
                        content = "http://" + content;
                    }
                    if (content.contains("51yougu.cn") || content.contains("p.cn") || content.contains("sulink.cn")) {
                        Intent intent = new Intent(getActivity(), WebActivity.class);
                        intent.putExtra(Constant.TO_WEBVIEW_URL, content);
                        startActivity(intent);
                        return;
                    }
                    showMessageDialog(getResources().getString(R.string.str_prepare_jump_third_url), content, getResources().getString(R.string.str_confirm), true);
                } else {
                    showMessageDialog(getResources().getString(R.string.str_scan_content), content, getResources().getString(R.string.str_copy), false);
                }
            }
        }
    }

    private void showMessageDialog(String title, final String content, final String confirm, final boolean flag) {
        new QMUIDialog.MessageDialogBuilder(getActivity()).setTitle(title).setMessage(content)
                .addAction(getResources().getString(R.string.str_cancel), new QMUIDialogAction.ActionListener() {
                    @Override
                    public void onClick(QMUIDialog dialog, int index) {
                        dialog.dismiss();
                    }
                }).addAction(confirm, new QMUIDialogAction.ActionListener() {
            @Override
            public void onClick(QMUIDialog dialog, int index) {
                dialog.dismiss();
                if (flag) {
                    Intent intent = new Intent(getActivity(), WebActivity.class);
                    intent.putExtra(Constant.TO_WEBVIEW_URL, content);
                    startActivity(intent);
                } else {
                    ClipboardHelper.getInstance(getActivity()).copyText("Label", content);
//                    //获取剪贴板管理器：
//                    ClipboardManager cm = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
//                    // 创建普通字符型ClipData
//                    ClipData mClipData = ClipData.newPlainText("Label", content);
//                    // 将ClipData内容放到系统剪贴板里。
//                    cm.setPrimaryClip(mClipData);
                }
            }
        }).show();
    }

    @Override
    public void onRegainData(View view) {
        if (noNetwork) {
            getPurseList();
        }
    }

    class LogginViewHolder {
        @BindView(R.id.qrCodeScanIv)
        ImageView mQrCodeScanIv;
        @BindView(R.id.mQMUIRadiusImageView)
        QMUIRadiusImageView mMQMUIRadiusImageView;
        @BindView(R.id.userNameTv)
        TextView mUserNameTv;
        @BindView(R.id.userNameIDTv)
        TextView mUserNameIDTv;

        LogginViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }

    class NotLogginViewHolder {
        @BindView(R.id.tv_view_asserts_login)
        TextView mTvLogin;
        @BindView(R.id.tv_view_asserts_register)
        TextView mTvRegister;

        NotLogginViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
